#/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'

import maya.cmds as cmds
#import maya.mel as mel

class Validation(object):
    name = u'EmptyGroup | 空组检查'
    order = 90
    dataDict = dict()
    def execute(self):
        self.dataDict = {}
        #mel.eval('string $findFmt = (uiRes("m_cleanUpScene.kFindingEmptyGroups"))')
        #mel.eval('string $uiString = `format -s 1 $findFmt`')
        #groupList = mel.eval('listEmptyGroups($uiString)')
        groupList = cmds.ls(transforms=1, leaf=1, l=1)
        if groupList:
            self.dataDict['EmptyGroups'] = groupList
        return self.dataDict

    def correct(self):
        #mel.eval('deleteEmptyGroups()')
        cmds.delete(self.dataDict['EmptyGroups'])

    def search(self, obj):
        cmds.select(self.dataDict['EmptyGroups'])